home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)abl.d64
/
QUIZ
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
8KB
|
196 lines
5 POKE691,1:GOTO320
10 SYS52440:IFA1%>.THENA$=LEFT$(SP$,A1%):SYS52360
15 RETURN
20 CLOSE4:CLOSE15:RETURN
25 A1%=-1:SYS52420:NL=NL+1:RETURN
30 CLOSE4:GOTO370
35 IQ=.:GOTO370
40 Q=.:OPEN4,8,4,"0:"+F$:OPEN15,8,15:INPUT#15,Q:IFQTHENPRINT#15,"I"
45 CLOSE4:CLOSE15:RETURN
50 A$="[194]UFFER FULL, EDIT AND SAVE!":GOSUB125:RETURN
55 SYS52300:IFA1%<0THEN95
60 A$=LEFT$(SP$,A1%):SYS52360:GOSUB725:O$=A$:RETURN
65 A$="[212]OPICS [193]VAILABLE:":GOSUB125:IFQA=.THENA$="[206]O [212]OPICS":GOSUB125:GOTO370
66 A$="### [209]UIZ [206]AME [193]UTHOR #[209]":GOSUB125
67 A$="--- --------------- --------------- --":GOSUB125
70 FORQ=0TOQA-1:A$=""+MID$(STR$(Q),2)+" - "+QT$(Q):GOSUB125:NEXT:A$="":GOSUB125:GOTO370
75 ON-(QT=QM)GOTO290:OPEN4,8,4,"0:/SUM"+STR$(QT)+",S,R":QM=QT
80 FORQ=1TO7:INPUT#4,QH$(Q),A$:QH(Q)=VAL(A$):NEXT:CLOSE4:RETURN
85 Q=.:FORL=1TO7:IFQH$(L)=N$THENQ=1
90 NEXT:RETURN
95 PRINT"[212][197]":GOTO795
100 IFRIGHT$(A$,1)=""THENA$=LEFT$(A$,LEN(A$)-1)
105 RETURN
110 SYS52340:RETURN
115 CLOSE15:OPEN15,8,15,"S0:/SUM"+STR$(QT):CLOSE15:OPEN4,8,4,"0:/SUM"+STR$(QT)+",S,W"
120 FORQ=1TO7:PRINT#4,QH$(Q)R$STR$(QH(Q))R$;:NEXT:CLOSE4:RETURN
125 PRINT"[152]";:GOSUB210:SYS52310:RETURN
130 FORK=0TONL-1:A1%=K:GOSUB10:PRINT#4,A$;:IFRIGHT$(A$,1)<>R$THENPRINT#4," ";
135 NEXTK:CLOSE4:ONQQGOTO195:GOTO30
140 IFQT=QATHENQA=QA+1:QT$(QA)=A$:GOTO150
145 QT$(QT)=A$
150 IFQA>1THENOPEN15,8,15,"S0:/QCAT":CLOSE15
155 OPEN4,8,4,"0:/QCAT,S,W":PRINT#4,MID$(STR$(QA),2)R$;:FORQ=0TOQA:PRINT#4,QT$(Q)R$;:NEXT:CLOSE4
160 RETURN
165 WA=.:FORQ=1TOAN:IFA$=AN$(Q)THENWA=1
170 NEXT:RETURN
175 WA=.:FORQ=1TOAN:FORL=1TOLEN(A$):IFMID$(A$,L,LEN(AN$(Q)))=AN$(Q)THENWA=1
180 NEXTL,Q:RETURN
185 WA=.:FORQ=1TOAN:IFVAL(A$)=VAL(AN$(Q))THENWA=1
190 NEXT:RETURN
195 QQ=.:OPEN4,8,4,"0:/TOPIC"+STR$(QT)+",S,A":NL=.:SYS52410:POKE680,CW:POKE682,1
200 IFCTTHENA$="[195]ONTINUING...":GOSUB125:CT=.:A$=LL$:GOSUB125:GOTO865
205 NEXTT:GOTO370
210 IFLL=1OR(PEEK(56577)AND16)=THTHENRETURN
215 GOTO800
220 POKE659,6+ABS((BD=1200)*2):C=1022730/BD:GOSUB285:POKE51968,A2%:POKE51969,A1%
225 IFBD=1200THENC=1022730/BD*.966:GOSUB285
230 POKE665,A2%:POKE666,A1%:C=1022730/BD/2-100:GOSUB285:POKE661,A2%:POKE662,A1%
235 RETURN
240 B$="[164]"
245 SYS52450:B$=LEFT$(A$,ABS(A1%-1)):RETURN
250 A$="":SYS52320:IFA2%=0THENRETURN
255 IFA2%=1ORA2%=3ORA2%=16ORA2%=9THENA$="[193]":RETURN
260 IFA2%<>83ANDA2%<>19THENRETURN
265 FORKK=1TO2E3:SYS52320:IFA2%=0THEN280
270 IFA2%=17ORA2%=67THENKK=2E3
275 IFA2%=65ORA2%=13THENA$="[193]":KK=2E3
280 NEXTKK:RETURN
285 A1%=C/256:A2%=C-A1%*256:RETURN
290 RETURN
295 GOSUB125:IFIT$=""THENGOSUB55:IT$=A$:GOSUB310:RETURN
300 GOSUB310:IFPEEK(679)<>1THENGOSUB125:O$=A$:A$="":GOSUB125:A$=O$
305 RETURN
310 A$=IT$:B$=":":GOSUB245:IFA1%=0THENIT$="":RETURN
315 IT$=MID$(A$,A1+1):A$=B$:RETURN
320 OPEN5,2,0:A1%=1:A2%=1:FORK=1TO127:SP$=SP$+" ":NEXTK:R$=CHR$(13)
325 A1%=0:GOSUB10:RK$=A$:ZE$=CHR$(0)
330 A1%=1:GOSUB10:BD=VAL(LEFT$(A$,5)):LL=VAL(MID$(A$,6)):A1%=2:GOSUB10:TH=VAL(A$)
335 A1%=4:GOSUB10:IT$=A$:GOSUB220:GOSUB715
340 QM=10:ON-(QA<>.)GOTO355:GOSUB75:OPEN4,8,4,"/QCAT,S,R":INPUT#4,A$:QA=VAL(A$):IFQA=.GOTO30
345 FORQ=0TOQA-1:IFST<>0THENCLOSE4:GOTO370
350 INPUT#4,QT$(Q):NEXT:CLOSE4:A$="":GOSUB125
355 A$="** [212]HE [209]UIZ [204]INK **":A$=LEFT$(SP$,(CW-LEN(A$))/2)+A$+"":GOSUB125
360 A$="[194]Y [196]AN [195]OLE (C)1988":A$=LEFT$(SP$,(CW-LEN(A$))/2)+A$+"":GOSUB125
363 A$="[214]ERSION 1.2":A$=LEFT$(SP$,(CW-LEN(A$))/2)+A$+"":GOSUB125
365 F$="[209][201][206][212][210][207]":GOSUB765:GOSUB250:B$="":A$="":O$="":IT$=""
370 GOSUB820:A$="[209]UIZ ("+MID$(STR$(QT),2)+") > ":GOSUB295:GOSUB110:IFA$=""THEN370
375 IFA$="[199]"ORLEFT$(A$,2)="[199][207]"ORA$="[216]"ORA$="[194][217][197]"THENIT$=A$:GOTO795
380 ON-(A$="[200]"ORA$="?"ORA$="[200][197][204][208]")GOTO415:IFA$="[194][194][211]"THEN795
385 IFLEFT$(A$,5)="[210][197][211][197][212]"ANDSC>7THENL=6:GOSUB695:ONIQGOTO35:GOTO635
390 IFLEFT$(A$,4)="[208][207][211][212]"ANDSC>7THENL=5:GOSUB695:ONABS(IQORQT>QA)GOTO35:GOTO430
395 ON-(A$="[204][201][211][212]")GOTO65:IFLEFT$(A$,4)="[209][213][201][218]"THENL=5:GOSUB695:ONIQGOTO35:GOTO540
400 IFLEFT$(A$,4)="[200][201][199][200]"THENL=5:GOSUB695:ONIQGOTO35:GOSUB670:GOTO370
405 IFLEN(A$)=1ANDASC(A$)>47ANDASC(A$)<58THENA$="[209][213][201][218]"+A$:GOTO395
410 GOTO370
415 F$="[209][200][197][204][208]":GOSUB765:GOSUB250:IFFF%=0THEN370
420 CLOSE1:OPEN1,8,15,"I":CLOSE1
425 GOTO370
430 F$="/TOPIC"+STR$(QT):GOSUB40:IFQTHEN445
435 A$="[212]OPIC"+STR$(QT)+" [197]XISTS, [210]EPLACE ? ":GOSUB295:IFA$<>"Y"THEN370
440 OPEN15,8,15,"S0:"+F$:CLOSE15
445 A$="[212]OPIC > ":GOSUB295:ON-(A$="")GOTO370:GOSUB140
450 A$="# OF [209]UESTIONS ? ":GOSUB295:IFA$=""GOTO370
455 Q=VAL(A$):IFQ<.ORQ>25GOTO450
460 OPEN4,8,4,"0:"+F$+",S,W":PRINT#4,MID$(STR$(Q),2)R$;:NL=.
465 A$="[200]IT [210][197][212][213][210][206][160]ON A BLANK LINE WHEN DONE.":GOSUB125
470 PL=55:SYS52410:POKE680,CW:POKE682,1
475 FORT=1TOQ:A$="[209]UESTION"+STR$(T)+"...":GOSUB125:GOSUB865:LL$=A$
480 A$="[193]NSWER [212]YPES:":GOSUB125
485 A$="[193] - [197]XACT[194] - [211]EARCH [211]TRING[195] - [206]UMERIC[196] - [195]ONTINUE[197] - [197]XIT":GOSUB125
490 A$="[212]YPE ? ":GOSUB295:GOSUB110:IFASC(A$+ZE$)<193ORASC(A$+ZE$)>197GOTO490
495 IFASC(A$)=196THENA$="[195]ONTINUING...":GOSUB125:A$=LL$+"":GOSUB125:GOSUB870:GOTO480
500 IFASC(A$)=197THENCLOSE4:OPEN15,8,15,"S0:"+F$:CLOSE15:GOTO370
505 A$="\"+R$+A$+R$:GOSUB25:L=1:A$="[197]NTER EACH ANSWER ON A LINE BY ITSELF":GOSUB125
510 A$="AND HIT [210][197][212][213][210][206][160]ON A BLANK LINE WHEN DONE.":GOSUB125
515 ON-(L=11)GOTO525:A$=MID$(STR$(L),2)+". ":GOSUB295:IFA$=""THEN525
520 Q$(L)=A$+R$:L=L+1:GOTO515
525 L=L-1:A$=MID$(STR$(L),2)+R$:GOSUB25:FORK=1TOL:A$=Q$(K):GOSUB25:NEXTK
530 IFNL>40THENQQ=1:GOSUB50:GOTO895
535 A$=" "+R$:NEXTT:A$="[212]OPIC COMPLETE, EDIT AND SAVE!":GOSUB125:GOTO895
540 GOSUB85:IFQTHENA$="[217]OU'RE IN THE HIGH SCORE!":GOSUB125:GOTO370
545 F$="/TOPIC"+STR$(QT):GOSUB40:IFQTHENA$="[212]OPIC [213]NAVAILABLE":GOSUB125:GOTO370
550 A$="[[209]]: "+QT$(QT):GOSUB125:OPEN4,8,4,"0:/TOPIC"+STR$(QT)+",S,R":INPUT#4,A$
555 QS=VAL(A$):A$="# OF [209]UESTIONS ="+STR$(QS)+"":GOSUB125:RA=.
560 FORT=1TOQS:A$="[209]UESTION :"+STR$(T)+"":GOSUB125
565 GET#4,C$:IFST<>0THENCLOSE4:OPEN4,8,4,"$":GOTO585
570 A$=LEFT$(SP$,CW):SYS52380:A$=C$+LEFT$(A$,A1%):C$="":IFA2%<1THENC$=""
575 IFMID$(A$,2,1)="\"THEN590
580 A3%=A2%:GOSUB125:GOSUB250:IFA$<>"[193]"ANDA3%<1THEN570
585 POKE684,0:AB%=-(A$="[193]"):GOTO30
590 INPUT#4,A$:GOSUB100:TT$=A$:INPUT#4,A$:AN=VAL(A$):FORQ=1TOAN:INPUT#4,A$:GOSUB100:GOSUB110
595 AN$(Q)=A$:NEXT
600 A$="> ":GOSUB295:GOSUB110:ON-(TT$="[193]")GOSUB165:ON-(TT$="[194]")GOSUB175:IFTT$="[195]"THENGOSUB185
605 A$="[201]NCORRECT":IFWATHENA$="[195]ORRECT":RA=RA+1
610 A$=A$+" [193]NSWER !":GOSUB125:NEXTT:QH=RA:CLOSE4:GOSUB660:IFL=.THEN630
615 IFQH<QH(7)THENA$="[217]OU SCORED"+STR$(QH)+" OUT OF"+STR$(QS)+" !":GOSUB125:GOTO630
620 A$="[217]OU [193]RE #"+MID$(STR$(Q),2)+" [207]N [212]HE [200]IGH [211]CORE [204]IST !":GOSUB125
625 A$="[211]TANDBY, [213]PDATING [211]CORES !":GOSUB125:GOSUB115:GOSUB670:GOTO370
630 A$="[214]IEW [200]IGH [211]CORES ? ":GOSUB295:GOSUB110:ON-(A$<>"[217]")GOTO370:GOSUB670:GOTO370
635 A$="[195]REATING [200]IGH [211]CORE [198]ILE !":GOSUB125:CLOSE15:OPEN15,8,15,"S0:/SUM"+STR$(QT)
640 CLOSE15:OPEN4,8,4,"0:/SUM"+STR$(QT)+",S,W":FORQ=1TO7
645 PRINT#4,"[200]IGH [211]CORE [210]ESET"R$"0"R$;:NEXT:QM=10:CLOSE4:GOSUB75:GOTO370
650 B$=MID$(STR$(K),2,3)+":":IFLEN(B$)<4THENB$=" "+B$
655 RETURN
660 L=.:FORQ=1TO7:ON-(QH>QH(Q))GOTO665:NEXT:RETURN
665 L=1:FORK=7TOQSTEP-1:QH$(K+1)=QH$(K):QH(K+1)=QH(K):NEXT:QH$(Q)=N$:QH(Q)=QH:RETURN
670 A$="[200]ALL OF [198]AME: [209]UIZ"+STR$(QT)+"":GOSUB125
675 A$="# [200]IGH [211]CORER [211]CORE":GOSUB125
680 A$="-------------------------------------":GOSUB125
685 FORQ=1TO7:Q$=MID$(STR$(Q),2)
690 A$=Q$+". "+QH$(Q)+LEFT$(SP$,31-LEN(QH$(Q)))+STR$(QH(Q))+R$:GOSUB125:A$="":NEXT:RETURN
695 QT=VAL(MID$(A$,L)):IFL-1=LEN(A$)THENIQ=1:RETURN
700 IFLEFT$(A$,4)<>"[208][207][211][212]"THENIFQT<.ORQT>QA-1THENA$="[201]NVALID [209]UIZ#":GOSUB125:IQ=1:RETURN
705 IFLEFT$(A$,5)="[210][197][211][197][212]"THENRETURN
710 GOSUB75:RETURN
715 A$=LEFT$(RK$,30):GOSUB240:N$=B$:SC=ASC(MID$(RK$,37,1)):CW=ASC(MID$(RK$,41,1))
720 RETURN
725 IFA2%<1THENRETURN
730 B$=A$:IFA2%<>67THEN745
735 A$="[195]HAT MODE.":GOSUB125:A1=PEEK(680):A2=PEEK(682):POKE680,37:POKE682,1
740 FORK=0TO1:GOSUB55:K=-(A$="/"):NEXTK:POKE680,A1:POKE682,A2:GOTO760
745 IFA2%<>84THEN755
750 TI$="000010":GOTO760
755 IFA2%=75THEN795
760 GOSUB55:A$=B$+A$:RETURN
765 GOSUB250:IFA$="[193]"THENRETURN
770 A$="":GOSUB125:POKE684,0:OPEN4,8,4,"0:"+F$+",S,R":GET#4,C$
775 FF%=0:IFST<>0THENFF%=1:CLOSE4:OPEN4,8,4,"$":GOTO790
780 A$=LEFT$(SP$,CW):SYS52380:A$=C$+LEFT$(A$,A1%):C$="":IFA2%<1THENC$=""
785 A3%=A2%:GOSUB125:GOSUB250:IFA$<>"[193]"ANDA3%<1THEN780
790 POKE684,0:AB%=-(A$="[193]"):A$="":GOSUB125:CLOSE4:RETURN
795 A$="([210]ETURNING TO [194][194][211])":GOSUB125:A$=""
800 PRINT:PRINT"[145][145][145][145]SYS52470:REM[145][145][145]"
805 SYS52410:A$=RK$:A1%=-1:SYS52420:A$=STR$(BD)+" "+STR$(LL):A1%=-1:SYS52420
810 A$=STR$(TH):A1%=-1:SYS52420:A$=IT$:A1%=-1:SYS52420:A$=""
815 POKE631,13:POKE198,1:CLOSE5:END
820 A=VAL(TI$)/100:B=SC*10--10:A=B-A:IFA<0THENA$="[217]":RETURN
825 A=VAL(MID$(STR$(A),2,3)):IFA>3THENRETURN
830 LP=LP--1:IFLP>3THENA$="[217]OU HAVE"+STR$(A)+" MINUTES LEFT.":GOSUB125:LP=0
835 RETURN
840 A$="0":IFLEN(E1$)>1THENA$=MID$(E1$,2)
845 C=VAL(A$):IFC>0ANDC<NLTHENRETURN
850 IFA$="0"THENC=0:RETURN
855 B$=A$:FORC=0TONL:A1%=C:GOSUB10:SYS52450:IFA1%>.THENRETURN
860 NEXTC:A$="[207]UT OF [210]ANGE!":GOSUB125:RETURN
865 BF=.:E1$=""
870 FORK=NLTOPL:BF=BF+1:IFBF>39THENLL$=A$:QQ=1:NL=K:CT=1:GOSUB50:GOTO895
875 GOSUB55
880 IFA$=""THENNL=K:RETURN
885 IFA2%>-1THENA$=A$+R$
890 A1%=-1:SYS52420:NEXTK:NL=K:RETURN
895 B$="":A5%=PEEK(680):A6%=PEEK(682):POKE680,40:POKE682,0
900 A$="> ":GOSUB125:GOSUB55:POKE680,A5%:POKE682,A6%:E1$=A$:IFNL<.THENNL=.
905 B$=A$:A$=LEFT$(B$,1):SYS52340:A1$=A$:A$=B$:B$=A1$
910 ON-(B$="[211]")GOTO130:IFB$="[204]"GOTO925
915 IFB$="[197]"GOTO945
920 GOTO895
925 C=.:GOSUB840
930 FORK=CTONL:GOSUB650:A1%=K:GOSUB10:IFRIGHT$(A$,1)<>R$THENA$=A$+""
935 A$=B$+A$:GOSUB125:GOSUB250:IFA$="[193]"THENK=NL
940 NEXTK:GOTO895
945 C=.:GOSUB840:A1%=C:K=C:GOSUB650:GOSUB10:A$=B$+A$+"":GOSUB125:A$=B$:GOSUB125:GOSUB55
950 IFA$<>""THENA1%=C:IFA2%>-1THENA$=A$+R$
955 IFA$<>""THENSYS52430:SYS52420
960 GOTO895